<include file="Public:header"/>
<style type="text/css">
.get-smscode,.smscode-time{
	position: absolute;
	left: 193px;
	top: 0px;
	display: inline-block;
	width: 126px;
	line-height: 42px;
	text-align: center;
	cursor: pointer;
	background-color: #009CDD;
	color: #FFF;
	border-radius: 3px;
}
.smscode-time{
	display: none;
}
.form_user .row .smscode-time span{
	position: relative;
    left: initial;
    top: inherit;
    width: initial;
    height: initial;
    display: inline-block;
}
.Validform_right{
	color: #71b83d !important;
}
</style>
<div class="main main_grey">
	<div class="user_wrap">
		<form class="ajax-form" action="" method="post">
		<div class="form_user">
			<div class="tab_menu">
				<ul class="clearfix">
					<li class="menu1"><a href="{:URL('Login/index', '', 'login')}">登录</a></li>
					<li class="menu2 cur"><a href="{:URL('User/lawyer_register', '', 'lawyer_register')}">律师注册</a></li>
				</ul>
			</div>
			<div class="content">
				<div class="row">
					<span class="icon icon_mobile">&nbsp;</span>
					<span class="name none">手机</span>
					<input type="text" name="mobile" placeholder="手机" class="text" datatype="mobile" ajaxurl="{:U('valid_field')}"/>
					<p class="error_tips Validform_checktip"></p>
				</div>
				<div class="show">
					<div class="row row_code">
						<span class="icon icon_code">&nbsp;</span>
						<span class="name none">验证码</span>
						<input type="text" name="imgcode" placeholder="请输入验证码" class="text" datatype="*"/>
						<a href="javascript:;" class="noneAjax"><img class="img-verify" href="{:U('Login/imgcode', 'w=126&h=42')}" src="{:U('Login/imgcode', 'w=126&h=42')}" /></a>
						<p class="error_tips Validform_checktip"></p>
					</div>
					<div class="row row_code">
						<span class="icon icon_code">&nbsp;</span>
						<span class="name none">短信验证码</span>
						<input type="text" name="smscode" class="smscode text" placeholder="短信验证码" autocomplete="off" datatype="*" style="width: 100px;">
						<p class="error_tips Validform_checktip"></p>
						<p class="get-smscode">获取验证码</p>
						<p class="smscode-time"><span>60</span>s</p>
					</div>
					<div class="row">
						<span class="icon icon_user">&nbsp;</span>
						<span class="name none">邮箱</span>
						<input type="text" name="email" placeholder="请输入邮箱" class="text" datatype="email" ajaxurl="{:U('valid_field')}" errormsg="请输入正确E-mail地址！"/>
						<p class="error_tips Validform_checktip"></p>
					</div>
					<div class="row">
						<span class="icon icon_psw">&nbsp;</span>
						<span class="name none">密码</span>
						<input type="password" name="password" placeholder="6-12位字符/数字/字母和符号两种以上组合" class="text" datatype="*6-16" nullmsg="请输入密码，不少于6位" />
						<p class="error_tips Validform_checktip"></p>
					</div>
					<div class="row">
						<span class="icon icon_psw">&nbsp;</span>
						<span class="name none">密码</span>
						<input type="password" name="repassword" placeholder="再次输入密码" class="text" datatype="*" recheck="password" nullmsg="请再输入一次密码！" errormsg="两次输入密码不一致！"/>
						<p class="error_tips Validform_checktip"></p>
					</div>
					<div class="agreement">
						<label>
							<input type="checkbox" name="check" checked class="radio_vlign" />
							我已阅读并同意米律<a href="{:U('Page/detail?module=lawyer_register_protocol')}" target="_blank">《律师注册协议》</a>
						</label>
					</div>
					<div class="submit">
						<input type="submit" name="" value="立即注册" class="btn" />
					</div>
				</div>				
			</div>
		</div>
		</form>
	</div>
</div>

<script type="text/javascript">
$(document).ready(function() {
	$('.img-verify').click(function () {
		var url = $(this).attr('href') + '?' + Math.random();
		$(this).attr('src', url);
		return false;
	});
	//获取验证码
	$('.get-smscode').click(function () {
		var mobile  = $('input[name="mobile"]').val();
		var imgcode = $('input[name="imgcode"]').val();
		if(!mobile){
			msgbox('手机号不能为空！', 'error');
			return false;
		}
		if(!imgcode){
			msgbox('图片验证码不能为空！', 'error');
			return false;
		}
		loading('获取验证码中...');
		$.ajax({
			type: "get",
			url: "{:U('get_smscode')}",
			data: 'type=register&mobile=' + mobile + '&imgcode=' + imgcode,
			dataType: "json",
			success: function(data){
				removeLoading();
				if(data.status == 1){
					$('.get-smscode').hide();
					$('.smscode-time').css('display', 'inline-block').find('span').text(60);
					msgbox(data.info);
					var wait = $('.smscode-time span');
					var smscode_interval = setInterval(function(){
						var time = wait.text();
							--time;
							wait.text(time);
						if(time == 0) {
							$('.smscode-time').hide();
							$('.get-smscode').show();
							clearInterval(smscode_interval);
						};
					}, 1000);
				}else{
					msgbox(data.info, 'error');
				}
			},
			error : function () {
				removeLoading();
				msgbox('请求失败！', 'error');
			}
		});
	});
});
</script>
<include file="Public:footer"/>